package com.dyypdadmin.service.impl;

import com.dyypdadmin.dao.PetsDao;
import com.dyypdadmin.pojo.Pets;
import com.dyypdadmin.service.PetsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PetsServiceImpl implements PetsService {

    @Autowired
    private PetsDao petsDao;

    @Override
    public int addPet(Integer userId, String petName, String breed, String description) {
        return petsDao.insertPet(userId, petName, breed, description);
    }

    @Override
    public int deletePetById(Integer petId) {
        return petsDao.deletePetById(petId);
    }

    @Override
    public int updatePet(Integer petId, String petName, String breed, String description) {
        return petsDao.updatePet(petId, petName, breed, description);
    }

    @Override
    public Pets getPetById(Integer petId) {
        return petsDao.getPetById(petId);
    }

    @Override
    public List<Pets> getPetsByUserId(Integer userId) {
        return petsDao.getPetsByUserId(userId);
    }

    @Override
    public int getPetCounts() {
        return petsDao.getPetCounts();
    }
}
